
//
// 130728 - AH - (Created).
//

package org.japril.jutil.pulse.demo;

import org.japril.jutil.logging.Log;
import org.japril.jutil.pulse.DefaultProduct;
import org.japril.jutil.pulse.Processor;
import org.japril.jutil.pulse.Product;
import org.japril.jutil.pulse.Products;

public class Sensor implements Processor
{
  public Sensor(){}

  @Override
  public void process(Products products)
  {
	if (products.getPulseName().equals("sense"))
	{
	  Log.log(this, "process", "looking for data of type text/xml");
	  Product[] prds=products.getProducts("text/xml");
	  for (Product product : prds)
	  {
	    Log.log(this, "process", "  processing: "+product);
	    
	    products.addProduct(new DefaultProduct("sensor-output", "sensed"));
	  }
	}
  }
  
  
}
